const api = require("./api/api.js");
App({
  onLaunch() {
    wx.http = api;//将api请求挂载到全局
    this.setSystemInfo() //设置系统系统
  },
  setSystemInfo() {
    let res = wx.getSystemInfoSync()
    let systemInfo = {
      model: res.model,
      system: res.system.toLowerCase(),
      rpxScale: res.windowWidth / 750, //官方规定750rpx为屏幕宽,
      screenWidth: res.screenWidth,
      screenHeight: res.screenHeight,
      windowHeight: res.windowHeight,
      windowWidth: res.windowWidth
    }
    this.globalData.systemInfo = systemInfo
    this.globalData.isIOS = res.system.toLowerCase().indexOf('ios') > -1;
    //自定义导航栏的信息
    this.globalData.statusBar = res.statusBarHeight;
    let custom = wx.getMenuButtonBoundingClientRect();
    this.globalData.custom = custom;
    this.globalData.customBar = custom.bottom + custom.top - res.statusBarHeight;
  },
  globalData: {
   
  }
})

